Ammo/health change from level trigger

Chat and ask questions about Water Gun Wars here!
mad.scientist
Member
Member
Posts: 7
Joined: November 13th, 2013, 7:58 am

Ammo/health change from level trigger

Postby mad.scientist » November 13th, 2013, 8:23 am

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

User avatar
Wind Astella
Member
Member
Posts: 112
Joined: June 4th, 2013, 6:18 am
Name: Nik Mirza
IRC Username: windastella
Contact:

Re: Ammo/health change from level trigger

Postby Wind Astella » November 13th, 2013, 9:18 am

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.

mad.scientist
Member
Member
Posts: 7
Joined: November 13th, 2013, 7:58 am

Re: Ammo/health change from level trigger

Postby mad.scientist » November 13th, 2013, 2:16 pm

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

User avatar
Wind Astella
Member
Member
Posts: 112
Joined: June 4th, 2013, 6:18 am
Name: Nik Mirza
IRC Username: windastella
Contact:

Re: Ammo/health change from level trigger

Postby Wind Astella » November 13th, 2013, 6:29 pm

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.

mad.scientist
Member
Member
Posts: 7
Joined: November 13th, 2013, 7:58 am

Re: Ammo/health change from level trigger

Postby mad.scientist » November 16th, 2013, 4:44 pm

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

User avatar
Wind Astella
Member
Member
Posts: 112
Joined: June 4th, 2013, 6:18 am
Name: Nik Mirza
IRC Username: windastella
Contact:

Re: Ammo/health change from level trigger

Postby Wind Astella » November 16th, 2013, 7:31 pm

Your welcome mad.scientist. Good luck teaching the children.

mad.scientist
Member
Member
Posts: 7
Joined: November 13th, 2013, 7:58 am

Re: Ammo/health change from level trigger

Postby mad.scientist » November 20th, 2013, 5:57 am


User avatar
Wind Astella
Member
Member
Posts: 112
Joined: June 4th, 2013, 6:18 am
Name: Nik Mirza
IRC Username: windastella
Contact:

Re: Ammo/health change from level trigger

Postby Wind Astella » November 20th, 2013, 9:06 pm

Great work mad.scientist. How is the children doing?

mad.scientist
Member
Member
Posts: 7
Joined: November 13th, 2013, 7:58 am

Re: Ammo/health change from level trigger

Postby mad.scientist » November 22nd, 2013, 1:37 pm

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.

User avatar
Wind Astella
Member
Member
Posts: 112
Joined: June 4th, 2013, 6:18 am
Name: Nik Mirza
IRC Username: windastella
Contact:

Re: Ammo/health change from level trigger

Postby Wind Astella » November 22nd, 2013, 8:46 pm

I like your dedication. Keep up with it.

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


Return to “Water Gun Wars!”

Who is online

Users browsing this forum: No registered users and 3 guests