Page 1 of 1

Ammo/health change from level trigger

Posted: November 13th, 2013, 8:23 am
by mad.scientist
Hi,
I have been trying to find a way of adding ammo and health changes using a level trigger in fps mode. The idea is to allow my younger students to collect coins and use them to buy health/ammo (renamed magic) from the mapname.cfg file. The reason for this is to keep the scripting to a single .cfg file for them.
I don't want to use the ammo pickups as the kids tend to just dump them onto the map without a thought to gameplay goals.
I have tried a variety of different methods which seemed intuitive to me but without success.

I don't suppose anyone knows if it is possible and if so what the syntax is?

Regards
John

Re: Ammo/health change from level trigger

Posted: November 13th, 2013, 9:18 am
by Wind Astella
So if I recall correctly, you wanted to implement a buy/sell system in fps mode. I think it is only possible in the RPG module though. It is possible if and only if the newent script can be trigger during game and not only in editmode but it don't. So I think it is impossible unless you mod the engine and compile a new.
You should refer to the Cube 2 reference for the full script.

Sorry if I wasn't helping.

Re: Ammo/health change from level trigger

Posted: November 13th, 2013, 2:16 pm
by mad.scientist
Thanks for that,
All ideas are good ideas, I'm just trying to avoid reinventing the wheel if the capability is there in fps .

Perhaps I do need to look at making a change in the source to add the function. The question is the best place to create a function that can be called in the config script.

It's not quite a buy an sell system. Rather I need to change ammo and health from the mapname.cfg file, 8 year olds often have issues with the multiple file system of rpg.

something like this..... (I know it's not right but it gives a basic idea of what I'm trying to achieve.)

level_trigger_3 = [ ammo[GUN_PISTOL] = 40; health = 30 ]

regards
John

Re: Ammo/health change from level trigger

Posted: November 13th, 2013, 6:29 pm
by Wind Astella
Here a small information I can give you, COMMAND and ICOMMAND functions are use to create a new script function. I am away from my computer right now so I can't remember what parameter you need to specify.
The variable for health and ammo, you can search it in the fps.h header file. It was declared there.

Hope you can achieve your goal.

Re: Ammo/health change from level trigger

Posted: November 16th, 2013, 4:44 pm
by mad.scientist
That's great stuff Wind, I will have a look into ICOMMAND and see what I can play with. I'm not a great C programmer but I should be able to make it work.
Many thanks.
John

Re: Ammo/health change from level trigger

Posted: November 16th, 2013, 7:31 pm
by Wind Astella
Your welcome mad.scientist. Good luck teaching the children.

Re: Ammo/health change from level trigger

Posted: November 20th, 2013, 5:57 am
by mad.scientist
the solution is here:


viewtopic.php?f=15&t=4428

Re: Ammo/health change from level trigger

Posted: November 20th, 2013, 9:06 pm
by Wind Astella
Great work mad.scientist. How is the children doing?

Re: Ammo/health change from level trigger

Posted: November 22nd, 2013, 1:37 pm
by mad.scientist
I'm just writing the next workshop at the moment. I have one student who, despite a massive IQ needs everything written step by step. Will post a link to Mage edition sandbox when I have finished modifying it.

Re: Ammo/health change from level trigger

Posted: November 22nd, 2013, 8:46 pm
by Wind Astella
I like your dedication. Keep up with it.

I think the forum need to have custom version section for modded version of engine.